package com.mrd.gtimpframe.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * 报关单单证发放记录
 * Created by Dengdc on 2017-11-16
 */
public class DeclaDocHanOutRecord implements Serializable {
    /**
     * ID
     */
    private String id;

    /**
     * 报关单ID
     */
    private String did;

    /**
     * 状态
     * 待申领 WAIT
     * 申领中 RECEIVING
     * 已申领 RECEIVED
     * 已发放 HANDED OUT
     */
    private String status;

    /**
     * 状态文字
     * 待申领
     * 申领中
     * 已申领
     * 已发放
     */
    private String statusText;

    /**
     * 备注说明
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 最后修改时间
     */
    private Date modifyTime;

    /**
     * 最后修改人
     */
    private String modifier;

    /**
     * 删除标识
     * 保留字段
     */
    private String delFlag;

    public enum StatusEnum{
        WAIT, RECEIVING, RECEIVED, HANDED_OUT;
        public static StatusEnum formOperationEnum(DeclaOperationRecord.OperationEnum oe){
            switch (oe){
                case DOC_WAIT:
                    return WAIT;
                case DOC_RECEIVING:
                    return RECEIVING;
                case DOC_RECEIVED:
                    return RECEIVED;
                case DOC_SEND:
                    return HANDED_OUT;
            }
            return WAIT;
        }
        public String cnString(){
            String cn = "";
            switch (this){
                case WAIT:
                    cn = "待申领";
                    break;
                case RECEIVING:
                    cn = "申领中";
                    break;
                case RECEIVED:
                    cn = "已申领";
                    break;
                case HANDED_OUT:
                    cn = "已发送";
            }
            return cn;
        }
    }

    private static final long serialVersionUID = 1L;

    public DeclaDocHanOutRecord(String id, String did, String status, String statusText, String remark, Date createTime, String creator, Date modifyTime, String modifier, String delFlag) {
        this.id = id;
        this.did = did;
        this.status = status;
        this.statusText = statusText;
        this.remark = remark;
        this.createTime = createTime;
        this.creator = creator;
        this.modifyTime = modifyTime;
        this.modifier = modifier;
        this.delFlag = delFlag;
    }

    public DeclaDocHanOutRecord() {
        super();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did == null ? null : did.trim();
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public String getStatusText() {
        return statusText;
    }

    public void setStatusText(String statusText) {
        this.statusText = statusText == null ? null : statusText.trim();
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator == null ? null : creator.trim();
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier == null ? null : modifier.trim();
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag == null ? null : delFlag.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", did=").append(did);
        sb.append(", status=").append(status);
        sb.append(", statusText=").append(statusText);
        sb.append(", remark=").append(remark);
        sb.append(", createTime=").append(createTime);
        sb.append(", creator=").append(creator);
        sb.append(", modifyTime=").append(modifyTime);
        sb.append(", modifier=").append(modifier);
        sb.append(", delFlag=").append(delFlag);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeclaDocHanOutRecord other = (DeclaDocHanOutRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getStatusText() == null ? other.getStatusText() == null : this.getStatusText().equals(other.getStatusText()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
            && (this.getModifyTime() == null ? other.getModifyTime() == null : this.getModifyTime().equals(other.getModifyTime()))
            && (this.getModifier() == null ? other.getModifier() == null : this.getModifier().equals(other.getModifier()))
            && (this.getDelFlag() == null ? other.getDelFlag() == null : this.getDelFlag().equals(other.getDelFlag()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getStatusText() == null) ? 0 : getStatusText().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getModifyTime() == null) ? 0 : getModifyTime().hashCode());
        result = prime * result + ((getModifier() == null) ? 0 : getModifier().hashCode());
        result = prime * result + ((getDelFlag() == null) ? 0 : getDelFlag().hashCode());
        return result;
    }
}
